<template>
  <div>
    <div>home</div>
    <div>-----</div>

    <a-button type="primary" @click="onLogout">注销再登录</a-button>
    <div>odoo version: {{ version_info.server_version }}</div>
  </div>
</template>

<script setup>
import api from '@/odoojs/index.js'

import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'

const router = useRouter()

const version_info = ref({})

onMounted(async () => {
  version_info.value = await api.web.webclient.version_info()
})

async function onLogout() {
  await api.logout()
  router.replace({ path: '/web/login' })
}
</script>
<style scoped></style>
